<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class CircleCategory extends Model
{
	use HasDateTimeFormatter;
    protected $table = 'circle_categories';


    public static function getOption()
    {
        $category = static::query()
            ->where('status',1)->get(['id','name']);

        if ($category->isEmpty()){
            return [];
        }

        $options = [];

        foreach ($category as $value){
            $options[$value->id] = $value->name;
        }


        return  $options;

    }

}
